<template>
  <div class="goods">
    <ul>
        <li v-for="(item) in goodsList" :key="item.id" @click='gotoDetail(item.id)'>
            <img :src="item.list_pic_url" alt="">
            <p>{{item.name}}</p>
            <span>{{item.retail_price|RMBformat}}</span>
        </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "",
  props: ["goodsList"],
  data() {
    return {};
  },

  components: {},

  computed: {},

  created() {},

  mounted() {},

  methods: {
    gotoDetail(item) {
      console.log(item);
      this.$router.push({ path: "/productDetail", query: { id: item} });
    },
  },
};
</script>
<style lang="less" scoped>
.goods{
    ul{
        display: flex;
        flex-wrap: wrap;
        li{
            width: 50%;
            font-size: 14px;
            text-align: center;
            line-height: 2;
            padding: 3px;
            box-sizing: border-box;
            white-space:nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            img{
                width: 100%;
            }
            span{
                color: darkred;
            }
        }
    }
}
</style>